<template>
  <div class="container">
    <img class="wheel" src="../assets/loto-p.png" />
    <img class="pointer" src="../assets/loto-z.png" alt="Pointer" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      rouletteImage: "path/to/roulette-image.png",
      pointerImage: "path/to/pointer-image.png",
      showPointer: false,
    };
  },
  mounted() {
    setTimeout(() => {
      document.querySelector(".container").classList.add("show-form");
    }, 2000);
    setTimeout(() => {
      document.querySelector(".container").style.animation = "none";
      document.querySelector(".pointer").style.animation = "none";
    }, 5000);
    setTimeout(() => {
      this.$router.push("page");
    }, 8000);
  },
};
</script>

<style scoped>
.container {
  position: relative;
  width: 200px;
  height: 200px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 0);
}

.wheel {
  width: 100%;
  height: 100%;
  background-image: url("../assets/loto-p.png");
  background-size: cover;
  background-position: center;
  animation: spin 5s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.pointer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  max-width: 80px;
  animation: spinPointer 5s linear infinite;
}

@keyframes spinPointer {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.form {
  display: none;
}

.show-form .form {
  display: block;
  animation: showForm 1s forwards;
}

@keyframes showForm {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
</style>
